var e = require, t = module, n = exports;

Object.defineProperty(n, "__esModule", {
    value: !0
});

var o = e("GameConfig"), i = e("WebManager"), a = function() {
    function e() {
        this.fsStartTime = 0, this.fsVideoAdTime = 0, this.fsRewardVideoAdTime = 0, this.fsVideoAdCount = 0;
    }
    return e.getInstance = function() {
        return this._instance || (this._instance = new e()), this._instance;
    }, e.prototype.init = function() {
        this.checkPlatform() && cc.systemEvent.on("videoEnd", this.doShowVideo, this);
    }, e.prototype.checkPlatform = function() {
        return GA.isPlatform([ GA.Platform.iOS, GA.Platform.Android ]);
    }, e.prototype.checkFSVideoAd = function(t) {
        if (GA.Info.underCheck) return !1;
        if (this.checkPlatform()) {
            var e = o.GC.fsVideoAdConfigList.filter(function(e) {
                return e.tag == t;
            });
            if (0 < e.length) return 0 != e[0].flag;
        }
        return !1;
    }, e.prototype.doShowFSVideo = function(e) {
        var t, n;
        GA.Info.underCheck || Date.now() < this.fsStartTime || Date.now() < this.fsVideoAdTime || Date.now() < this.fsRewardVideoAdTime || (this.checkFSVideoAd(e) ? this.fsVideoAdCount >= o.GC.fsVideoAdCount ? (null === (n = null === (t = GA.PA) || void 0 === t ? void 0 : t.showFullScreenVideoAd) || void 0 === n || n.call(t), 
        i.default.getInstance().sentLog("fullScreenVideoAdShow", null, e), console.log("fullScreenVideoAd " + e + " do show"), 
        this.fsVideoAdCount = 0, this.fsVideoAdTime = Date.now() + 1e3 * o.GC.fsVideoAdTime) : (this.fsVideoAdCount++, 
        console.log("fullScreenVideoAd " + e + " not show")) : console.log("fullScreenVideoAd " + e + " not config"));
    }, e.prototype.doShowVideo = function() {
        this.fsRewardVideoAdTime = Date.now() + 1e3 * o.GC.fsRewardVideoAdTime;
    }, e._instance = null, e;
}();

n.default = a;